package com.itheima.mylambda.text4;

public class Test {
    public static void main(String[] args){
        feed(new Animal(){
            public void eat(){
                System.out.println("狗吃骨头");
            }
            public void sleep(){
                System.out.println("狗在睡觉");
            }
        });
    }
    public static void feed(Animal a){
        a.eat();
    }
}
abstract class Animal{
    public abstract void eat();
    public abstract void sleep();
}